home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14206 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.kolumbus.fi!usenet
  2. From: "R.K.Brand" <ralph@www.partio.fi>
  3. Newsgroups: comp.lang.c
  4. Subject: How to detect EOF?/filepointer problem.
  5. Date: Sat, 13 Apr 1996 04:00:02 -0700
  6. Organization: Kolumbus Information Network, Finnet Group
  7. Message-ID: <316F8932.2BAF@www.partio.fi>
  8. NNTP-Posting-Host: kasav6.kauniainen.fi
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win16; I)
  13.  
  14. Sorry to bother you, but I have a problem 
  15. while scanning through a file too see whether 
  16. or not a certain word occurs.
  17. When I run out of file, fscanf() keeps 
  18. returning the last line, instead of some NULL 
  19. value I would find logical (but who am I?).
  20.  
  21. How can I test for the end of the file?
  22.  
  23. The second problem is how to manipulate a 
  24. pointer of type "FILE"..so, a filepointer.
  25. At a certain point I want to skip 11 chars back 
  26. in the file and start writing.
  27.  
  28. string-=11; gives me an error and after
  29. string--; fprintf(string,"foo"); does not do 
  30. anything anymore.
  31.  
  32. I you respond to this one, please do also mail 
  33. me a copy.
  34.  
  35. Thanks,
  36.  
  37.     Roel.
  38.